package cn.school.demo.ui.my_answer

import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel
import cn.school.demo.pojo.Answer
import cn.school.demo.pojo.Subject
import cn.school.demo.repository.AnswerRepository

class MyAnswerViewModel : ViewModel() {
    private val _answerList = mutableListOf<Subject>()
    val answerList: MutableList<Subject> get() = _answerList

    var newY: Float = 0f
    var oldY: Float = 0f
    var isBottom = false
    var isTop = false

    fun updateAnswerList(list: MutableList<Subject>) {
        _answerList.clear()
        _answerList.addAll(list)
    }

    fun getSubjectListByTrueTime(): LiveData<MutableList<Subject>> =
        AnswerRepository().getSubjectListByTrueTime()
}